<template>
	<view class="wanlfind-follow-container"  style="background-color: white;">
		<view class="edgeInsetTop"></view>
		<wanl-empty src="apply" text="您的申请正在审核中,请耐心等待 !" v-if="hostData.status == 0"/>
		<wanl-empty src="apply" text="您还不是主播,请提交资料并缴纳保证金后提交审核 !" v-if="hostData.status != 0"/>
		
		<view class="edgeInsetBottom"></view>
		<view style="height: 441rpx;">
			<button style="background-color: #ff4632;width: 46%;border-radius: 25px;color: white;" @tap="$wanlshop.auth('/pages/user/applyHost')" v-if="hostData.status != 0">提交资料</button>
			<button style="background-color: #ff4632;width: 46%;border-radius: 25px;color: white;"  v-if="hostData.status == 0">审核中</button>
			<button   style="color: #ff4632;width: 46%;border-radius: 25px;margin-top: 23px;border: 1px solid red;">缴纳保证金	</button>
		</view>
		
		<!-- 加载更多 -->
		<!-- <uni-load-more :status="status" :content-text="contentText" /> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				hostData:{
					status:3
				},
				reload: false, //判断是否上拉
				current_page: 1, //当前页码
				last_page: 1, //总页码
				status: 'loading',
				type:1,
				contentText: {
					contentdown: '',
					contentrefresh: '疯狂加载中...',
					contentnomore: ''
				}
			}
		},
		onLoad(option) {
			this.type = option.type
			
			this.loadData();
		},
		onPullDownRefresh() {
			this.current_page = 1;
			this.reload = true;
			this.loadData();
		},
		onReachBottom() {
			//判断是否最后一页
			if (this.current_page >= this.last_page) {
				this.status = 'noMore';
			} else {
				this.reload = false;
				this.current_page = this.current_page + 1; //页码+1
				this.status = 'loading';
				this.loadData();
			}
		},
		methods: {
			async loadData() {
				this.$api.post({
					url: '/wanlshop/host/index',
					success: res => {
						if(res){
							this.hostData.status = res.status; //数据 追加
						}
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	.wanlfind-follow-container {
		&__list {
			.item {
				display: flex;
				align-items: center;

				.cu-avatar {
					width: 100rpx;
					height: 100rpx;
					flex-shrink: 0;
					background-color: #f9f9f9;
				}

				.subject {
					display: flex;
					align-items: center;
					justify-content: space-between;
					flex: 1;

					.info {
						max-width: 250rpx;
					}

					.menu {
						display: flex;
						align-items: center;
					}
				}
			}
		}
	}
</style>